#100,被3和7整除的数字
# from random import randint
#
# for i in range(1,100+1):
#     if i%3==0 and i%7==0:
#         print(i)
#猜数字，30以内
# num = randint(1,100)
# while True:
#     guess = int(input("请输入一个数字:"))
#     if guess > num :
#         print("太大了")
#     elif guess < num:
#         print(("太小了"))
#     else :
#         print("猜对了")
#         break
#九九乘法表
    # for i in range(1,10):
    #  for j in range (1,i+1):
    #      print(f"{j}*{i}={i*j}",end='\t')
    #  print()
#水仙花数
# for i in range(100,1000):
#     a=i//100
#     b=i//10%10
#     c=i%10
#     if a**3+b**3+c**3==i:
#         print(i)
from imaplib import Flags


#100以内质数
#
# def is_prime(n):
#     """判断一个数是否为质数"""
#     if n <= 1:
#         return False
#     for i in range(2, int(n ** 0.5) + 1):
#         if n % i == 0:
#             return False
#     return True
#
# def print_primes(start, end):
#     """打印指定范围内的所有质数"""
#     primes = []
#     for num in range(start, end + 1):
#         if is_prime(num):
#             primes.append(num)
#     return primes
#
# # 打印 1 到 100 范围内的所有质数
# primes = print_primes(1, 100)
# print(primes)

#100以内完数
for i in range(1,101):
    a=0
    for j in range(1,i):
        if i % j ==0:
            a += j
    if a == i:
        print(i)
# def wan(n):
#     if n <1:
#         return False
#     sum = 0
#     for i in range(1,n):
#         if n % i ==0:
#             sum += i
#     return sum == n
# def wanshu(start ,end):
#     ws=[]
#     for j in range(start ,end+1):
#         if wan(j):
#             ws.append(j)
#     return ws
# ws = wanshu(1,100)
# print(ws)

#斐波那契
def f1(n):
    if n <=0:
        return []
    elif n == 1:
        return [0]
    elif n == 2:
        return [0,1]
    fib=[0,1]
    for i in range (2,n):
        fib.append(fib[-1]+fib[-2])
    return fib
print(f1(39))

#菱形
for i in range(1,11+1,2):
    print(("*"*i).center(11))
for j in range(9,0,-2):
    print(("*"*j).center(11))